package com.itheima.shoufa;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class TcpDataReceiver {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(7001);
        Socket socket = serverSocket.accept();
        BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String data;

        while((data = br.readLine())!=null){
            System.out.println(data);
        }
        br.close();
        socket.close();
        serverSocket.close();


    }
}
